package com.njym.java.security.admin.rest;


import com.github.pagehelper.PageInfo;
import com.njym.java.security.admin.biz.PersonalIdentificationBiz;
import com.njym.java.security.admin.entity.IdentityApply;
import com.njym.java.security.admin.entity.IdentityApplyVo;
import com.njym.java.security.admin.entity.PersonalIdentification;
import com.njym.java.security.common.msg.ObjectRestResponse;
import com.njym.java.security.common.rest.BaseController;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("personalIdentification")
public class PersonalIdentificationController extends BaseController<PersonalIdentificationBiz,PersonalIdentification> {

    @RequestMapping(value = "/check",method = RequestMethod.GET)
    @ResponseBody
    public ObjectRestResponse<IdentityApply> check(String status, String id){
        if (!"undefined".equals(id) && id != null && !"undefined".equals(status) && status != null) {
            Integer ids = Integer.parseInt(id);
            Integer sta = Integer.parseInt(status);
            PersonalIdentification personalIdentification = new PersonalIdentification();
            personalIdentification.setId(ids);
            personalIdentification.setStatus(sta);
            baseBiz.updateSelectiveById(personalIdentification);
        }

        Map<String, Object> data = new HashMap<>(2);

        return new ObjectRestResponse<IdentityApply>().rel(true).data(data);

    }
}